#ifndef WIDGET_H_
#define WIDGET_H_

#include <stdio.h>
#include <list>
#include <iostream>

#include "SDL/SDL.h"
#include "SDL/SDL_image.h"

#include "Parcel.h"
#include "Event.h"
#include "../common/utils/SurfaceUtils.h"

class Widget {

protected:

	Parcel parcel;
	SDL_Surface* surface;
	Widget* parent;

    Parcel getPosition();
    Parcel getBorderLimits();
    void initParcel(int posX, int posY);

public:
    Widget(int posX, int posY, SDL_Surface *surface, Widget *parent = NULL);
    Widget(int posX, int posY, std::string imageSurface, Widget *parent = NULL);
    virtual void handleEvent(Event event) =0;
    virtual void resolve() =0;
    virtual void showOn(SDL_Surface *surface) =0;
    bool isMouseOver(Event event) const;
    virtual ~Widget();

};

#endif /* WIDGET_H_ */
